local PromptBox = class("PromptBox", require "widget/BaseUI")

function PromptBox.show( content )
    print("============PromptBox.show===============")

    local win = PromptBox.new()

    local data = getWndInitParamList()
    data.isRemoveResource = false
    data.imgTitle = nil
    data.bgImage = nil
    data.isShowCover = false,

    win:init(data,content)
    win:showWindow()

    return win

end

function PromptBox:ctor() 
    self.super:ctor() 
end


function PromptBox:init(data,content)
    self:initWithParas(data)
    self:setLocalZOrder(99)
    cc.SpriteFrameCache:getInstance():addSpriteFrames("ui/launcher0.plist")
    cc.SpriteFrameCache:getInstance():addSpriteFrames("ui/launcher1.plist")
    local centerbg = SpriteWithFrame("ui/launcher/wndhelper.png")
    self:setContentSize(centerbg:getContentSize())
    self:addChild(centerbg)
    local label = cc.Label:createWithSystemFont(content, DEFAULT_FONT_BOLD, 32, cc.size(600, 0), 1, 1)
    self:addChild(label)
    
    local listener = cc.EventListenerTouchOneByOne:create()
    listener:registerScriptHandler(handler(self, self.onTouchBegan), cc.Handler.EVENT_TOUCH_BEGAN)
    listener:registerScriptHandler(handler(self, self.onTouchMoved), cc.Handler.EVENT_TOUCH_MOVED)
    listener:registerScriptHandler(handler(self, self.onTouchEnded), cc.Handler.EVENT_TOUCH_ENDED)
    listener:setSwallowTouches(self.m_isSwollowTouch)
    local eventDispatcher = self:getEventDispatcher()
    eventDispatcher:addEventListenerWithSceneGraphPriority(listener, self)

end

function PromptBox:onTouchBegan(touch, event)
    self:closeWindow()
    return true
end

function PromptBox:onTouchMoved(touch, event)
end

function PromptBox:onTouchEnded(touch, event)
 
end



return PromptBox